const http = require('http')
// node中使用打包出的js文件
const { test } = require('../dist/js/main.js')
console.log('node:', test)

const app = http.createServer((req, res) => {
  console.log(req.url);

  if (req.url === '/user') {
    res.end('user')
    return
  }
  res.end('hello server')
})

app.listen(3000, 'localhost', () => {
  console.log('server start: localhost:3000');
})